/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Wires.impl;

import EA_Model.IEC61970.Core.impl.CurveImpl;

import EA_Model.IEC61970.Domain.Pressure;
import EA_Model.IEC61970.Domain.Temperature;

import EA_Model.IEC61970.Wires.ReactiveCapabilityCurve;
import EA_Model.IEC61970.Wires.WiresPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Reactive Capability Curve</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.ReactiveCapabilityCurveImpl#getCoolantTemperature <em>Coolant Temperature</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.ReactiveCapabilityCurveImpl#getHydrogenPressure <em>Hydrogen Pressure</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ReactiveCapabilityCurveImpl extends CurveImpl implements ReactiveCapabilityCurve {
	/**
	 * The cached value of the '{@link #getCoolantTemperature() <em>Coolant Temperature</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCoolantTemperature()
	 * @generated
	 * @ordered
	 */
	protected Temperature coolantTemperature;

	/**
	 * The cached value of the '{@link #getHydrogenPressure() <em>Hydrogen Pressure</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getHydrogenPressure()
	 * @generated
	 * @ordered
	 */
	protected Pressure hydrogenPressure;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ReactiveCapabilityCurveImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return WiresPackage.Literals.REACTIVE_CAPABILITY_CURVE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Temperature getCoolantTemperature() {
		if (coolantTemperature != null && coolantTemperature.eIsProxy()) {
			InternalEObject oldCoolantTemperature = (InternalEObject)coolantTemperature;
			coolantTemperature = (Temperature)eResolveProxy(oldCoolantTemperature);
			if (coolantTemperature != oldCoolantTemperature) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.REACTIVE_CAPABILITY_CURVE__COOLANT_TEMPERATURE, oldCoolantTemperature, coolantTemperature));
			}
		}
		return coolantTemperature;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Temperature basicGetCoolantTemperature() {
		return coolantTemperature;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCoolantTemperature(Temperature newCoolantTemperature) {
		Temperature oldCoolantTemperature = coolantTemperature;
		coolantTemperature = newCoolantTemperature;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.REACTIVE_CAPABILITY_CURVE__COOLANT_TEMPERATURE, oldCoolantTemperature, coolantTemperature));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Pressure getHydrogenPressure() {
		if (hydrogenPressure != null && hydrogenPressure.eIsProxy()) {
			InternalEObject oldHydrogenPressure = (InternalEObject)hydrogenPressure;
			hydrogenPressure = (Pressure)eResolveProxy(oldHydrogenPressure);
			if (hydrogenPressure != oldHydrogenPressure) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.REACTIVE_CAPABILITY_CURVE__HYDROGEN_PRESSURE, oldHydrogenPressure, hydrogenPressure));
			}
		}
		return hydrogenPressure;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Pressure basicGetHydrogenPressure() {
		return hydrogenPressure;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setHydrogenPressure(Pressure newHydrogenPressure) {
		Pressure oldHydrogenPressure = hydrogenPressure;
		hydrogenPressure = newHydrogenPressure;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.REACTIVE_CAPABILITY_CURVE__HYDROGEN_PRESSURE, oldHydrogenPressure, hydrogenPressure));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case WiresPackage.REACTIVE_CAPABILITY_CURVE__COOLANT_TEMPERATURE:
				if (resolve) return getCoolantTemperature();
				return basicGetCoolantTemperature();
			case WiresPackage.REACTIVE_CAPABILITY_CURVE__HYDROGEN_PRESSURE:
				if (resolve) return getHydrogenPressure();
				return basicGetHydrogenPressure();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case WiresPackage.REACTIVE_CAPABILITY_CURVE__COOLANT_TEMPERATURE:
				setCoolantTemperature((Temperature)newValue);
				return;
			case WiresPackage.REACTIVE_CAPABILITY_CURVE__HYDROGEN_PRESSURE:
				setHydrogenPressure((Pressure)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case WiresPackage.REACTIVE_CAPABILITY_CURVE__COOLANT_TEMPERATURE:
				setCoolantTemperature((Temperature)null);
				return;
			case WiresPackage.REACTIVE_CAPABILITY_CURVE__HYDROGEN_PRESSURE:
				setHydrogenPressure((Pressure)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case WiresPackage.REACTIVE_CAPABILITY_CURVE__COOLANT_TEMPERATURE:
				return coolantTemperature != null;
			case WiresPackage.REACTIVE_CAPABILITY_CURVE__HYDROGEN_PRESSURE:
				return hydrogenPressure != null;
		}
		return super.eIsSet(featureID);
	}

} //ReactiveCapabilityCurveImpl
